package com.ruoyi.web.service;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.itextpdf.text.DocumentException;
import com.ruoyi.web.bean.PdfLocation;
import com.ruoyi.web.bean.VerifyResult;
import com.ruoyi.web.dto.SealDto;

import java.io.ByteArrayOutputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.Date;
import java.util.List;

public interface CQYCSignService {
    JSONObject signPDF(JSONArray seals,String documentCode,String businessSys,String signUser);
    public byte[] signPDF(JSONArray seals,byte[] pdfFileByte,String businessSys,String signUser);

    byte[] addSeal(byte[] pdfPath, byte[] imgFile, float width, float height , int pageNum, float x, float y,
                   SealDto sealDto, String signatureName, Date date) throws IOException, DocumentException;
    byte[] addOverSeal(SealDto sealDto, byte[] pdfFileByte,String signatureName,Date date) throws IOException, DocumentException;
    List<VerifyResult> verifyPdfSign(byte[] file);
    PdfLocation findLocationByKeyword(String keyword, byte[] fileName, int num);
    List<PdfLocation> findLocationByKeywordAll(String keyword, byte[] file);
    PdfLocation findLocationByBookMark(String keyword, byte[] file);
    PdfLocation findLocationByXY(float X, float Y,int pageNum);
    boolean sendSuccess(String SYSID, String documentCode);
    byte[] webSign(SealDto seal, byte[] hashValue);
    boolean webDocumentVerifySM(byte[] bPlain, byte[] bCert,byte[] bSignVal);
    boolean webDocumentVerifyRSA(byte[] bPlain, byte[] bCert,byte[] bSignVal);
    boolean webCertVerify(byte[] bCert);
    JSONObject signOFD(JSONArray seals, String documentCode, String businessSys);
}
